﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;

namespace Admin.NET.Application;

/// <summary>
/// 客户基础输入参数
/// </summary>
public class SyscustomerBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 客户编码
    /// </summary>
    [Required(ErrorMessage = "客户编码不能为空")]
    public virtual string Code { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    [Required(ErrorMessage = "客户名称不能为空")]
    public virtual string CustomerName { get; set; }
    
    /// <summary>
    /// 所属行业
    /// </summary>
    public virtual string? Industry { get; set; }
    
    /// <summary>
    /// 客户来源
    /// </summary>
    public virtual string? CustomerSource { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    public virtual string? ContactPerson { get; set; }
    
    /// <summary>
    /// 联系电话
    /// </summary>
    public virtual string? ContactPhone { get; set; }
    
    /// <summary>
    /// 电子邮箱
    /// </summary>
    public virtual string? Email { get; set; }
    
    /// <summary>
    /// 销售部门Id
    /// </summary>
    public virtual long? SalesDeptId { get; set; }
    
    /// <summary>
    /// 销售负责人Id
    /// </summary>
    public virtual long? SalesManagerId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Required(ErrorMessage = "状态不能为空")]
    public virtual int? Status { get; set; }
    
    /// <summary>
    /// 客户地址
    /// </summary>
    public virtual string? CustomerAddress { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
    /// <summary>
    /// 账户名称
    /// </summary>
    public virtual string? AccountName { get; set; }
    
    /// <summary>
    /// 纳税人识别号
    /// </summary>
    public virtual string? TaxpayerId { get; set; }
    
    /// <summary>
    /// 银行账户
    /// </summary>
    public virtual string? BankAccount { get; set; }
    
    /// <summary>
    /// 开户银行
    /// </summary>
    public virtual string? OpeningBank { get; set; }
    
    /// <summary>
    /// 开户行地址
    /// </summary>
    public virtual string? OpeningBankAddress { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    [Required(ErrorMessage = "排序不能为空")]
    public virtual int? OrderNo { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>
    public virtual DateTime? DeleteTime { get; set; }
    
}

/// <summary>
/// 客户分页查询输入参数
/// </summary>
public class PageSyscustomerInput : BasePageInput
{
    /// <summary>
    /// 客户编码
    /// </summary>
    public string Code { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    public string CustomerName { get; set; }
    
    /// <summary>
    /// 所属行业
    /// </summary>
    public string? Industry { get; set; }
    
    /// <summary>
    /// 客户来源
    /// </summary>
    public string? CustomerSource { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    public string? ContactPerson { get; set; }
    
    /// <summary>
    /// 联系电话
    /// </summary>
    public string? ContactPhone { get; set; }
    
    /// <summary>
    /// 电子邮箱
    /// </summary>
    public string? Email { get; set; }
    
    /// <summary>
    /// 销售部门Id
    /// </summary>
    public long? SalesDeptId { get; set; }
    
    /// <summary>
    /// 销售负责人Id
    /// </summary>
    public long? SalesManagerId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    public int? Status { get; set; }
    
    /// <summary>
    /// 客户地址
    /// </summary>
    public string? CustomerAddress { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 账户名称
    /// </summary>
    public string? AccountName { get; set; }
    
    /// <summary>
    /// 纳税人识别号
    /// </summary>
    public string? TaxpayerId { get; set; }
    
    /// <summary>
    /// 银行账户
    /// </summary>
    public string? BankAccount { get; set; }
    
    /// <summary>
    /// 开户银行
    /// </summary>
    public string? OpeningBank { get; set; }
    
    /// <summary>
    /// 开户行地址
    /// </summary>
    public string? OpeningBankAddress { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    public int? OrderNo { get; set; }
    
    /// <summary>
    /// 软删除时间范围
    /// </summary>
     public DateTime?[] DeleteTimeRange { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 客户增加输入参数
/// </summary>
public class AddSyscustomerInput
{
    /// <summary>
    /// 客户编码
    /// </summary>
    [Required(ErrorMessage = "客户编码不能为空")]
    [MaxLength(64, ErrorMessage = "客户编码字符长度不能超过64")]
    public string Code { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    [Required(ErrorMessage = "客户名称不能为空")]
    [MaxLength(128, ErrorMessage = "客户名称字符长度不能超过128")]
    public string CustomerName { get; set; }
    
    /// <summary>
    /// 所属行业
    /// </summary>
    [MaxLength(64, ErrorMessage = "所属行业字符长度不能超过64")]
    public string? Industry { get; set; }
    
    /// <summary>
    /// 客户来源
    /// </summary>
    [MaxLength(64, ErrorMessage = "客户来源字符长度不能超过64")]
    public string? CustomerSource { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    [MaxLength(64, ErrorMessage = "联系人字符长度不能超过64")]
    public string? ContactPerson { get; set; }
    
    /// <summary>
    /// 联系电话
    /// </summary>
    [MaxLength(32, ErrorMessage = "联系电话字符长度不能超过32")]
    public string? ContactPhone { get; set; }
    
    /// <summary>
    /// 电子邮箱
    /// </summary>
    [MaxLength(128, ErrorMessage = "电子邮箱字符长度不能超过128")]
    public string? Email { get; set; }
    
    /// <summary>
    /// 销售部门Id
    /// </summary>
    public long? SalesDeptId { get; set; }
    
    /// <summary>
    /// 销售负责人Id
    /// </summary>
    public long? SalesManagerId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Required(ErrorMessage = "状态不能为空")]
    public int? Status { get; set; }
    
    /// <summary>
    /// 客户地址
    /// </summary>
    [MaxLength(256, ErrorMessage = "客户地址字符长度不能超过256")]
    public string? CustomerAddress { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [MaxLength(512, ErrorMessage = "备注字符长度不能超过512")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 账户名称
    /// </summary>
    [MaxLength(128, ErrorMessage = "账户名称字符长度不能超过128")]
    public string? AccountName { get; set; }
    
    /// <summary>
    /// 纳税人识别号
    /// </summary>
    [MaxLength(32, ErrorMessage = "纳税人识别号字符长度不能超过32")]
    public string? TaxpayerId { get; set; }
    
    /// <summary>
    /// 银行账户
    /// </summary>
    [MaxLength(32, ErrorMessage = "银行账户字符长度不能超过32")]
    public string? BankAccount { get; set; }
    
    /// <summary>
    /// 开户银行
    /// </summary>
    [MaxLength(128, ErrorMessage = "开户银行字符长度不能超过128")]
    public string? OpeningBank { get; set; }
    
    /// <summary>
    /// 开户行地址
    /// </summary>
    [MaxLength(256, ErrorMessage = "开户行地址字符长度不能超过256")]
    public string? OpeningBankAddress { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    [Required(ErrorMessage = "排序不能为空")]
    public int? OrderNo { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>
    public DateTime? DeleteTime { get; set; }
    
}

/// <summary>
/// 客户删除输入参数
/// </summary>
public class DeleteSyscustomerInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 客户更新输入参数
/// </summary>
public class UpdateSyscustomerInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 客户编码
    /// </summary>    
    [Required(ErrorMessage = "客户编码不能为空")]
    [MaxLength(64, ErrorMessage = "客户编码字符长度不能超过64")]
    public string Code { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>    
    [Required(ErrorMessage = "客户名称不能为空")]
    [MaxLength(128, ErrorMessage = "客户名称字符长度不能超过128")]
    public string CustomerName { get; set; }
    
    /// <summary>
    /// 所属行业
    /// </summary>    
    [MaxLength(64, ErrorMessage = "所属行业字符长度不能超过64")]
    public string? Industry { get; set; }
    
    /// <summary>
    /// 客户来源
    /// </summary>    
    [MaxLength(64, ErrorMessage = "客户来源字符长度不能超过64")]
    public string? CustomerSource { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>    
    [MaxLength(64, ErrorMessage = "联系人字符长度不能超过64")]
    public string? ContactPerson { get; set; }
    
    /// <summary>
    /// 联系电话
    /// </summary>    
    [MaxLength(32, ErrorMessage = "联系电话字符长度不能超过32")]
    public string? ContactPhone { get; set; }
    
    /// <summary>
    /// 电子邮箱
    /// </summary>    
    [MaxLength(128, ErrorMessage = "电子邮箱字符长度不能超过128")]
    public string? Email { get; set; }
    
    /// <summary>
    /// 销售部门Id
    /// </summary>    
    public long? SalesDeptId { get; set; }
    
    /// <summary>
    /// 销售负责人Id
    /// </summary>    
    public long? SalesManagerId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>    
    [Required(ErrorMessage = "状态不能为空")]
    public int? Status { get; set; }
    
    /// <summary>
    /// 客户地址
    /// </summary>    
    [MaxLength(256, ErrorMessage = "客户地址字符长度不能超过256")]
    public string? CustomerAddress { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(512, ErrorMessage = "备注字符长度不能超过512")]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 账户名称
    /// </summary>    
    [MaxLength(128, ErrorMessage = "账户名称字符长度不能超过128")]
    public string? AccountName { get; set; }
    
    /// <summary>
    /// 纳税人识别号
    /// </summary>    
    [MaxLength(32, ErrorMessage = "纳税人识别号字符长度不能超过32")]
    public string? TaxpayerId { get; set; }
    
    /// <summary>
    /// 银行账户
    /// </summary>    
    [MaxLength(32, ErrorMessage = "银行账户字符长度不能超过32")]
    public string? BankAccount { get; set; }
    
    /// <summary>
    /// 开户银行
    /// </summary>    
    [MaxLength(128, ErrorMessage = "开户银行字符长度不能超过128")]
    public string? OpeningBank { get; set; }
    
    /// <summary>
    /// 开户行地址
    /// </summary>    
    [MaxLength(256, ErrorMessage = "开户行地址字符长度不能超过256")]
    public string? OpeningBankAddress { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>    
    [Required(ErrorMessage = "排序不能为空")]
    public int? OrderNo { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>    
    public DateTime? DeleteTime { get; set; }
    
}

/// <summary>
/// 客户主键查询输入参数
/// </summary>
public class QueryByIdSyscustomerInput : DeleteSyscustomerInput
{
}

/// <summary>
/// 客户数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportSyscustomerInput : BaseImportInput
{
    /// <summary>
    /// 客户编码
    /// </summary>
    [ImporterHeader(Name = "*客户编码")]
    [ExporterHeader("*客户编码", Format = "", Width = 25, IsBold = true)]
    public string Code { get; set; }
    
    /// <summary>
    /// 客户名称
    /// </summary>
    [ImporterHeader(Name = "*客户名称")]
    [ExporterHeader("*客户名称", Format = "", Width = 25, IsBold = true)]
    public string CustomerName { get; set; }
    
    /// <summary>
    /// 所属行业
    /// </summary>
    [ImporterHeader(Name = "所属行业")]
    [ExporterHeader("所属行业", Format = "", Width = 25, IsBold = true)]
    public string? Industry { get; set; }
    
    /// <summary>
    /// 客户来源
    /// </summary>
    [ImporterHeader(Name = "客户来源")]
    [ExporterHeader("客户来源", Format = "", Width = 25, IsBold = true)]
    public string? CustomerSource { get; set; }
    
    /// <summary>
    /// 联系人
    /// </summary>
    [ImporterHeader(Name = "联系人")]
    [ExporterHeader("联系人", Format = "", Width = 25, IsBold = true)]
    public string? ContactPerson { get; set; }
    
    /// <summary>
    /// 联系电话
    /// </summary>
    [ImporterHeader(Name = "联系电话")]
    [ExporterHeader("联系电话", Format = "", Width = 25, IsBold = true)]
    public string? ContactPhone { get; set; }
    
    /// <summary>
    /// 电子邮箱
    /// </summary>
    [ImporterHeader(Name = "电子邮箱")]
    [ExporterHeader("电子邮箱", Format = "", Width = 25, IsBold = true)]
    public string? Email { get; set; }
    
    /// <summary>
    /// 销售部门Id
    /// </summary>
    [ImporterHeader(Name = "销售部门Id")]
    [ExporterHeader("销售部门Id", Format = "", Width = 25, IsBold = true)]
    public long? SalesDeptId { get; set; }
    
    /// <summary>
    /// 销售负责人Id
    /// </summary>
    [ImporterHeader(Name = "销售负责人Id")]
    [ExporterHeader("销售负责人Id", Format = "", Width = 25, IsBold = true)]
    public long? SalesManagerId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [ImporterHeader(Name = "*状态")]
    [ExporterHeader("*状态", Format = "", Width = 25, IsBold = true)]
    public int? Status { get; set; }
    
    /// <summary>
    /// 客户地址
    /// </summary>
    [ImporterHeader(Name = "客户地址")]
    [ExporterHeader("客户地址", Format = "", Width = 25, IsBold = true)]
    public string? CustomerAddress { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
    /// <summary>
    /// 账户名称
    /// </summary>
    [ImporterHeader(Name = "账户名称")]
    [ExporterHeader("账户名称", Format = "", Width = 25, IsBold = true)]
    public string? AccountName { get; set; }
    
    /// <summary>
    /// 纳税人识别号
    /// </summary>
    [ImporterHeader(Name = "纳税人识别号")]
    [ExporterHeader("纳税人识别号", Format = "", Width = 25, IsBold = true)]
    public string? TaxpayerId { get; set; }
    
    /// <summary>
    /// 银行账户
    /// </summary>
    [ImporterHeader(Name = "银行账户")]
    [ExporterHeader("银行账户", Format = "", Width = 25, IsBold = true)]
    public string? BankAccount { get; set; }
    
    /// <summary>
    /// 开户银行
    /// </summary>
    [ImporterHeader(Name = "开户银行")]
    [ExporterHeader("开户银行", Format = "", Width = 25, IsBold = true)]
    public string? OpeningBank { get; set; }
    
    /// <summary>
    /// 开户行地址
    /// </summary>
    [ImporterHeader(Name = "开户行地址")]
    [ExporterHeader("开户行地址", Format = "", Width = 25, IsBold = true)]
    public string? OpeningBankAddress { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    [ImporterHeader(Name = "*排序")]
    [ExporterHeader("*排序", Format = "", Width = 25, IsBold = true)]
    public int? OrderNo { get; set; }
    
    /// <summary>
    /// 软删除时间
    /// </summary>
    [ImporterHeader(Name = "软删除时间")]
    [ExporterHeader("软删除时间", Format = "", Width = 25, IsBold = true)]
    public DateTime? DeleteTime { get; set; }
    
}
